home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / a3dsimple-sim.lha / README < prev    next >
Text File  |  1998-07-28  |  19KB  |  422 lines

  1.                      A  simple 3D flight simulator.
  2.                            (using amos 3d)
  3.  
  4.   Author: David Lawrence.
  5.  
  6.                =====================================
  7.  
  8.   This is a hasty upload as the author is about to be cut off from the
  9. internet (due to not having amiga stuff to handle provider's system changes).
  10.  
  11. This  program runs ok , but there's no time to balance up the values, level
  12. control, tidy up etc. so as to turn it into a decent game.   
  13.  
  14.  SKIP to the  bottom of this file under the heading ' THIS PROGRAM', for
  15. controls not  mentioned  on  game screen and which may help adjust things, ...
  16.         .. and to get the game scenario..
  17.  
  18.  
  19. If you want to change the landscape of this sim. you will need to download
  20. the  A3Dscape   program which is to follow to aminet if possible..
  21.  
  22.                ======================================
  23.  
  24.  
  25.  This archive is put here so that some people might get a bit of fun from
  26. this  experiment,  and so other amos  programmers can freely use,
  27. modify, improve on,  (or just have a good laugh at )  one persons attempt
  28. to overcome rotation limits in amos 3d.  This flight sim shows every flaw
  29. and limit of amos 3d! .. it's not entirely my fault that it's like this!!
  30.  It is quite possible that after running this your other programs will
  31. crash.
  32.  
  33.  On  A1200 with fast ram and 28 mhz cpu  it will average about 12 f.p.s.
  34. There is a crude time limit to prevent very fast machines from producing
  35. uncontrollable action.  A standard A1200 will produce a SLOOW motion effect.
  36. Should  run on Pal and nstc.
  37.  
  38.  
  39. The archive includes:-
  40. - a compiled workbench version for non-amos users
  41. - amos source code  -   needs  voodoo 3d extension to edit and run.
  42. - the necessary sample bank, screens, 3d objects
  43.  
  44. -   ( note- the 3d library is a required  part of the compiled version, as
  45.            per the 3d manual,.. it's not an amos extension.
  46.          Also,  the 3d extension referred to herein is
  47.           the 'voodoo' 3d extn,   not 'stars'  or  other)
  48.  
  49.  
  50. The program expects all the above archive to be extracted ( contents
  51. and sub-directories)   into one main  directory.. (any name)
  52.  
  53.  
  54. To contact author  try  posting  to
  55.  
  56.                    D. Lawrence
  57.                    Rock Road
  58.                    R.D.7
  59.                    Pahiatua
  60.                    New Zealand
  61.  
  62.  
  63.                       ......................
  64.                    ==============================
  65.  
  66.       Some stuff from previous upload for anyone interested.
  67.  
  68. If anyone wants to obtain amos 3d I have no suggestions that are legal.
  69. You could try annoying Europress?.
  70.  Though it sounds like maybe someone else has the rights to the 3d code and
  71. object modeller.
  72.         But in mid 1995 I wrote many pages of criticism of amos 3d
  73. to them, and received back an offer to replace the object modeller with
  74. the latest version if I sent the original discs back.
  75. Since that was hardly the response  I wanted I did nothing,  but it means
  76. that they could  supply original stuff at that point.  Their letter in reply
  77. was actually quite reasonable... .
  78.  
  79. It was on a mag. disk some years ago, you may find a friend who has a copy.
  80. There must be thousands around somewhere.   Maybe amos mail list people
  81. could mount a campaign to get all unused copies into a 'pool'... err ..is it
  82. legal to buy and sell (or give) such original mag discs???. with the mag?
  83.  Or since they must know that such disks will have been freely copied and
  84. spread, are they really worried one way or the other??
  85.   The object modeller though, really needs the manual to sort out the use.
  86.  And note the mag. version is for amos 1.35 and apparently will crash
  87. amos pro if you try to run it as an extension.  The 3d for Amos Pro was
  88. on an extras disk I hear, for that program.
  89.  
  90.          As an alternative :-
  91. It should be possible to use AMCAF vector rotations for Amos pro to make a
  92. 3d  program.   I think that's what I might  try  now if starting again.
  93. And you could make use of full colours etc. And make a better object modeller.
  94. .....at least as long as you kept it all simple.
  95.    You would need some   simple trig. for putting the amcaf rotations
  96.  to use in a '3d world' ,     or someone can produce a master set of
  97. amos code routines, totally optimised....yes?
  98.  
  99. But it would be a LOT OF WORK,and probably need some assembler routines
  100. if you wanted to handle  large numbers of co-ords. Or to check for surfaces
  101. and lines that are both in front of and  behind the viewpoint, as in a
  102. full 3d system..
  103.  
  104.                  ........ ....................
  105.                  .............................
  106.  
  107. Feel free to use anything here for your own programs. Or to upgrade the
  108. whole thing,  I have spent too much time worrying to optimise properly.
  109.  There may well be some other way to improve A3d ..  go to it.
  110.       (and let me know how please..)
  111. Those with the Amos pro version, and a fast machine, may  be able to
  112. use the amcaf blitter commands to copy bit planes (with masking) and
  113. extend the A3d colour range.
  114.  
  115.  
  116.  I believe that really, a complete new, and faster 3d system- using fast ram
  117.  (bit planes or chunky) and cpu drawing techniques is what is needed for amos.
  118.  It may be possible to do quite a lot with the amcaf vector rotation
  119.  commands.    But then, one needs a polygon command which doesn't crash
  120. the machine when off screen right somewhere!
  121.  
  122.  
  123.                ..... food for Thought....
  124.    No one else seems to think so, but I believe (from a position of moderate
  125. ignorance)    that  on the A1200,  the use of bit planes in FAST ram  could
  126.  be turned to advantage by drawing (triangular) polygons completely with
  127. pre selectable  horizontal lines....(from table of 'slope')
  128.  Hence storing large areas with few   ' Moves'. (Then blasting to chip ram
  129. quickly for dislay when finished.)
  130.  
  131. The advantage of 'chunky' is the ease of finding a pixel address, but this
  132. may not count against the possibility above..after all, you would only need
  133. to find the 3 points of the triangle this way. (and they could use a 'table
  134. referencing' approach anyway).
  135.   No need for - 'lines first' and then  'filling' afterwards.
  136.  
  137.      Has  anyone actually tried  such a system?  or is it impossible?
  138. It strikes me, from my old 6502 code programming  attempts, as a relatively
  139. simple thing to be done . Just one optimised routine which would transform
  140. the output  of the amiga for polygon 3d..
  141.   Pity I don't want to get familiar with 68000 code... (lazy sod)
  142.  
  143. I would like to know the outcome speed wise.   Years ago a mag disk had a
  144. 'VR world' prog which  could be switched between blitter, rom routines,
  145.  or cpu code for a polygon style.  The last was fastest and I don't think it
  146. was even drawing in fast ram... just direct to chip.
  147.  
  148. Some people are doing routines with cpu and blitter. This  sounds a good
  149. idea, except that you are not using the cpu in a fast ram screen where it
  150. really moves.
  151. Or maybe everyone  else prefers  the doom/corridor style with chunky style
  152. screen and  texture mapping.     OK, whatever..  Go to it.
  153.  
  154. I just  hope someone might  come up with something before the Amiga expiry
  155. date  passes.
  156.         Or my expiry date!!
  157.  
  158.  
  159. Also... sorry to have not got this stuff out much earlier when amos and 3d
  160. were  still officially around,  and this might have been of some  use.
  161.  But I was  isolated in a bit of a personal black hole,  and the internet
  162. was not on my event horizon at all.  And is likely now to disappear again!
  163.  
  164.  
  165.           Good luck all.
  166.                                 David L.
  167.  
  168.  
  169.              ...............................................
  170.              ...............................................
  171.  
  172.  
  173.       ABOUT AMOS 3D,   and rotations, as applied to this program.
  174. (nearly a repeat  of previous uploads but with application to flight sim.)
  175.            ( skip to heading  THIS PROGRAM  if not interested)
  176.  
  177. This writer was depressed  to discover that amos3d is not ideal.
  178. It is quite fast for a blitter system, and I find the commands fit my
  179.  way of thinking .
  180.       BUT... problems include...
  181. There are very restricted colour choices, it can write over screen
  182. edges and  crash from (seemingly)  memory problems, and since it uses
  183. masking to draw objects ( probably to gain speed), it is incompatible
  184. with other drawing operations.   Also the screen conversion doesn't handle
  185. off screen positions.  All these  problems are very in evidence in
  186. trying to make a flight sim!
  187.  And the object modeller though it has some good ideas, drives me completely
  188. up the wall.
  189. Hence the minimal objects in  programs I have made).
  190.  
  191.     But above all, the rotation angles are limited, and do not match the
  192. manual which implies the ability to rotate objects and viewpoint about
  193. their own axes with simple commands..
  194.  In fact the z rotation axis  of objects  and viewpoint remain
  195. permanently aligned with the z axis of the co-ord world.
  196.  
  197.    It did not have to be that way as the amcaf vector rotations for example
  198. seem to rotate relative to their current alignment.. using matrix maths.
  199.   It may be possible to use  complex  sin* cos formula to make amos3d
  200. work that way,  but all my attempts failed at the angle extremes..
  201. (My '3dtests' dir is full of things like;- 3dcalc, novertcalc, nearlythere,
  202.  frontworks, .... very depressing.  And I can't even understand them now)
  203.                          -------------------
  204.  
  205.   The partial solution used here and in my other programs, is to change the
  206.  normal point of view and hence the apparent way the objects rotate.
  207.     It's as simple as setting the initial view angle at rt. angles to normal
  208. on the A angle axis .
  209. And then being sure you put your objects in the new world ground plane
  210. of X, Y co-ords   (instead of x,z as normal) with their A angles also moved
  211.  one rt angle...
  212.  
  213.       It may be clearest to visualize as follows;-
  214. Imagine you have stuck your head into the co-ord world through your monitor
  215. and are looking straight down.   Now twist  your head to look to your right.
  216. The effect from your point of view, is that the world z axis now seems
  217. vertical  ( i.e. off the  top of your head )  while the x goes away
  218. into the distance ahead and the y goes from side to side.
  219.  
  220.     Your ground objects are put on the new ground plane,( which from the old
  221.   point of view was the plane parallel to, or 'made by' the monitor screen )
  222.      For convenience I chose start angles which gave positive z upwards,
  223. positive x away into distance, y positive  to the right,   but the x,y
  224. (set by initial  angle c ) could be any chosen direction.
  225.                            
  226.    The main thing is that while the z axis rotations still remain aligned
  227. with the 'world' z axis, this is no longer the longitudinal Z  axis of the
  228. objects and viewpoint... from your new  point of view.
  229.  
  230.                               -------------- 
  231.    It is possible now to point an object  in any world direction on  the
  232. z axis (angle c), elevate  with angle B, and roll any angle with A.
  233.  
  234. I'll  call this;-   mode3
  235.  
  236.  The limits of this are:-
  237.          1.   The object can not use td forward, since the rolling angle A
  238. is not the axis used by td forward.
  239.  Instead you have to use a sin/cos formula to move.
  240.                 ( see source code A3Dmodelsim))
  241.          2. since the viewpoint cannot align along the A angle/ axis
  242. the VIEWPOINT  cannot be flown about as in a proper flight sim.
  243.          3. A seperate 'yaw' response is too difficult to arrange.
  244.  
  245.     None the less it is possible to fly  an object around properly if
  246. it is saved from the object modeller at right angles (pointed left) to the
  247. normal angle.  (if you used td forward it would go sideways)
  248.  
  249.    This is the mode used by the previous 'A3Dmodelsim'. It was very tricky
  250. to understand how to adjust the rotation angles as the object pointed
  251. upwards in the world..  because the roll angle (A) gradually becomes a change
  252. in the direction in the world. (angle C )
  253.   It's in the source code for that prog.  but if anyone needs more I could
  254. supply notes.. once I've  re- worked it out myself!  (Don't think this was
  255. worked out by some  blinding quick brain.  It mostly happened by hours of
  256. experiment over many months, and step by step advance.   NOW it seems simple)
  257.  
  258.                   ..............................
  259.  
  260.       It is possible though, to use td foward for objects and viewpoint
  261. with the world in this orientation,  if you use angle  B for rolling and A
  262. for elevation.     Angle C  still sets world direction.
  263.    Call this mode 2
  264.  
  265.  
  266. The limits of this mode are:-
  267.          1. the B rolling axis  is always parallel to the 'ground' plane.
  268.            (Though you can point it in any direction on that plane.)
  269. Therefore when you elevate with angle A  and try to roll with B, the object
  270. or view 'skews' or 'barrel rolls' it's nose around in an arc.
  271. The greater the elevation the greater the skew.
  272.   It is possible to use a simple sin (or cos?, I forget) to reverse the
  273. skew in the inverted part of the roll.
  274.              This is just enough to make it useable as a limited flight
  275. sim with a proper travelling viewpoint but held within limits up and down.
  276.  
  277.  
  278.  
  279.                 ----------------------------------
  280.  
  281.                          THIS  PROGRAM
  282.                 ===================================
  283. Since the above was written the rotation  process  has been changed for
  284. better control.              The roll angle was  limited, and it became
  285.   possible to increase the down/up limits  and get also a compensation
  286.   that enabled the view  to point  and roll almost  exactly as
  287. in 'proper' flight sim.      Look at the  'adjustview'  part of prog. to see
  288. how each angle change gets an input from other angles to keep the view
  289. pointed in the right direction. 
  290.  It would be also possible to get a loop capability, but would need work
  291. to move the "sky" object correctly and to have an automatic return to
  292. upright at the top of the loop if one didn't continue looping back to
  293. level  flight.
  294.  
  295. Amos programmers  may be interested in the way the landscape is sorted out.
  296. Data is set onto a 40,40 grid. As the view moves about, a projection ahead
  297. selects a central  grid square at a  variable distance ahead depending on
  298. altitude   (but not vertical attitude).   Every time this point  moves by
  299.  equivalent of one grid square, all ground objects are "killed" and a new set
  300. of objects ( 1 per grid square) invoked.
  301. Not  ideal, since re- invoking is slow but it's tricky to sort out which
  302. objects can be retained for the next selection.
  303. The area covered is limited to a square surrounding  the centre plus
  304. a selection from  more distant grids... if roads or water  etc.
  305.  Not the best, but  there is no  way with amos3d of drawing distance
  306.  polygons for large areas of land or of using lines for roads. 
  307.  
  308.  
  309.  
  310.               ===  Extra controls on program ====
  311.  
  312.  As said this is a rush job.
  313.                             To compensate, there is ability to change the
  314. time interval between re-appearances of the enemy aircraft  which, while
  315.  the plane is over the operations area,  causes  "damage".
  316.  
  317. Use key M  for  more time,  N to reduce.  The figure will be printed on the
  318. cockpit frame.   
  319.  
  320. Also  there is  a cheat on key  4
  321. This will put the enemy plane right in front of you.
  322.  
  323.  
  324.               .....  GAME SCENARIO ......
  325.  
  326. It is suddenly discovered that enemy underground elements have been secretly
  327. constructing masts which guide in high speed enemy jet bombers.
  328. Whenever  the bomber is  over the territory the damage indicator, on bottom
  329. left of HUD area goes red, and counts up.   100%--  you lose..
  330.  
  331. Your weapon is a proximity missile... which you have to aim with a feel for
  332. it's 3d position,   as it's unguided.       (on fire button)
  333. The targets appear on the main map  and on the relative map 3.
  334.  (Map 3 can be zoomed with Z or shrunk with X.)
  335.  
  336.  
  337. If you can wipe out all the masts  you win.
  338. But as you get the masts the underground repairs them!
  339. At the set start level, one should be able to get all the masts without
  340. taking any notice of the enemy plane.
  341.                         Once you get the feel of what speed to go,--
  342.  
  343. Too long airbourne may lead to stopping to refuel, and more time loss..
  344.  (Fuel is blue bar on cockpit right.)
  345.      Note..
  346.  You automatically refuel if you land on the runway succesfully.
  347.  Which means not too fast or steep. Aim for about 120-140 speed as displayed
  348. on the bottom left of HUD area.    You will stall gradually below 120.
  349. The relative map 2 can make it much easier to line up with the runway.
  350. Note that the main runway ( with lines on and lying north/south) is the only
  351. fully fuctional one.
  352.  
  353.  
  354. To make a harder level, the time between enemy re-appearance gets shorter.
  355. Depending on how fast you can get around the targets, you will then HAVE to
  356. start shooting the enemy down.  This sets back the underground rebuilding
  357. and puts the enemy plane off screen for a good time so that you can get on
  358. with demolishing masts.
  359.  However -it can take quite a long time to track  down the plane...
  360. And it may go off limit just before you get there, when it will accelerate
  361. very fast away into it's own territory....
  362.  
  363.  I  tend  to use the main map 1 to check if it's heading 'out' and then the
  364. relative radar map 2 to  track it down and  when trying  to get behind
  365. and/ or  fire the rocket.
  366. And you will need to refuel  as the flight time gets much higher.
  367.  
  368.  
  369.  
  370. It's at this point I have not time to balance up all the factors to see if
  371. they work properly.
  372. Perhaps I'll find another way to get connected to the internet, and can
  373. organise  this program  better.
  374.  
  375. But it's more likely to be with a PC of some sort,  if I can stand it,
  376. and it will probably be goodbye to the Amiga.......
  377.  
  378. In any case, see if you can have some fun with the prog. I personally like
  379. the high speed chase after the enemy plane when  it's low or going through
  380. the mountain areas. Or just racing about at full speed.  A simple mind...
  381.  
  382.                      .......................
  383.  
  384.    Complete controls
  385.  
  386. joystick         flight control
  387. fire button       missile
  388.  
  389. A           add power
  390. S           less power
  391.  (note there is inertia, speed follows later- power is red line on right)
  392.  
  393. 1          normal map
  394. 2         relative map -enemy and airstrip
  395. 3       relative map -targets
  396.  
  397. P            pause
  398. Z          zoom map 3
  399. X          unzoom map  3
  400. R          reset to runway
  401.  
  402. N          reduce time between enemy plane visits
  403. M          more time between enemy visits
  404.  
  405. 4         move enemy plane directly before view.    
  406. 8         make new enemy come from 'outside'
  407.  
  408. < and  >  experiment to move the scenery further out and in
  409.  
  410. K    strange  'set colour  in program' idea (one colour resets back in prog)
  411. D         toggles  distant "spots on/off
  412.  
  413. C        stop program with sound volume  OFF !!#$#$
  414.  
  415. L        this will produce  a file selector to get a different landscape
  416.          and may be useful at some stage...?
  417.  
  418.                      ------------------------ 
  419.                      -----------------------
  420.  
  421.  
  422.